home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: (void(far *)()) 0
- Date: 05 Feb 1996 23:29:33 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb5162933@qcd.lanl.gov>
- References: <341998718.10858110@magnet.at> <31165B9D.398E@imsisoft.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Victor Bazarov's message of Mon, 05 Feb 1996 11:33:49 -0800
-
- In article <31165B9D.398E@imsisoft.com> Victor Bazarov
- <vbazarov@imsisoft.com> writes:
- <snip>
- markus imlinger wrote:
- >
- > In a C-Programm I saw the instruction:
- > .... = (void(far *)()) 0;
- >
- > It seems that (void(far *)()) is a cast-
- > operator.
- >
- > If so this instruction casts 0 to a far-
- > pointer to a function which returns nothing.
-
- And has no parameters.
-
- Incorrect. In C, () means an unknown but fixed number of parameters.
-
- Of course, with the far in place, it really doesn't mean anything in
- ANSI C: so, who knows what the compiler makes of it?
-
- > Now I want to know if my assumption is right and
- > in case it is, what does this mean for 0 ?
-
- Nothing but what you've said -- cast. '0' has type 'int',
- and must be converted into pointer to function in order
- to be properly assigned.
-
- More importantly, in this context (assuming the word far is deleted),
- 0 is a null pointer constant, which means casting it to a pointer type
- results in a null pointer of the appropriate type.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-